<template>
  <div>
    <V-CommonHeaderLeft>
      <div id="app">
        <el-row>
          <!-- 头部 -->
          <div class="header">
            <el-col :span="4" class="header-nav">
              <router-link to="/">首页&nbsp;&nbsp;/</router-link>
              <router-link to="/">客户&nbsp;&nbsp;/</router-link>
              <router-link to="/">客户列表&nbsp;&nbsp;/</router-link>
              <router-link to="/">客户信息</router-link>
            </el-col>
            <el-col :span="1" :offset="18">
              <img src alt class="shuImg">
            </el-col>
          </div>
        </el-row>
        <div class="contents">
          <div class="contentsAb">
            <span class="spanEdit">编辑</span>
            <span class="spanDel">删除</span>
            <span class="spanStop">停用</span>
          </div>
          <el-tabs v-model="activeName" class='activeName'>
            <el-tab-pane label="基本信息" name="first">
              <div class="myInfo">
                <div class="contents-message">
                  <h3>| 基本信息</h3>
                  <div class="contents-message-header">
                    <el-row class="messageRow1">
                      <el-col :span="10" class="messageRow1Td">
                        <span>客户名称</span>
                        <span>tiong</span>
                      </el-col>
                      <el-col :span="10" :offset="2" class="messageRow1Td">
                        <span>客户类型</span>
                        <span style="display:inline-block;margin-left:20px">普通代理商（折扣比例100%）</span>
                      </el-col>
                    </el-row>
                    <el-row class="messageRow1">
                      <el-col :span="10" class="messageRow1Td">
                        <span>客户编号</span>
                        <span>miri01</span>
                      </el-col>
                      <el-col :span="10" :offset="2" class="messageRow1Td">
                        <span>默认发货仓库</span>
                        <span>总部仓库</span>
                      </el-col>
                    </el-row>
                    <el-row class="messageRow1">
                      <el-col :span="10" class="messageRow1Td">
                        <span>归属区域</span>
                        <span>子区域</span>
                      </el-col>
                      <el-col :span="10" :offset="2" class="messageRow1Td">
                        <span>所在地区</span>
                      </el-col>
                    </el-row>
                    <el-row class="messageRow1">
                      <el-col :span="10" class="messageRow1Td">
                        <span>联系地址</span>
                      </el-col>
                      <el-col :span="10" :offset="2" class="messageRow1Td">
                        <span>邮编</span>
                      </el-col>
                    </el-row>
                    <el-row class="messageRow1">
                      <el-col :span="10" class="messageRow1Td">
                        <span>所属员工</span>
                        <span>王审单02</span>
                      </el-col>
                      <el-col :span="10" :offset="2" class="messageRow1Td">
                        <span>备用信息</span>
                      </el-col>
                    </el-row>
                    <el-row class="messageRow1">
                      <el-col :span="10" class="messageRow1Td2">
                        <span>营业执照</span>
                        <img src alt class="messageImg">
                      </el-col>
                    </el-row>
                  </div>
                </div>
                <div class="contentsPer-message">
                  <h3>| 联系人信息</h3>
                  <div class="contents-message-header">
                    <el-row class="messageRow1">
                      <el-col :span="10" class="messageRow1Td">
                        <span>客户名称</span>
                      </el-col>
                      <el-col :span="10" :offset="2" class="messageRow1Td">
                        <span>客户类型</span>
                      </el-col>
                    </el-row>
                    <el-row class="messageRow1">
                      <el-col :span="10" class="messageRow1Td">
                        <span>客户编号</span>
                      </el-col>
                      <el-col :span="10" :offset="2" class="messageRow1Td">
                        <span>默认发货仓库</span>
                      </el-col>
                    </el-row>
                    <el-row class="messageRow1">
                      <el-col :span="10" class="messageRow1Td">
                        <span>归属区域</span>
                      </el-col>
                      <el-col :span="10" :offset="2" class="messageRow1Td">
                        <span>所在地区</span>
                      </el-col>
                    </el-row>
                  </div>
                </div>
                <div class="contentsPer-message">
                  <div class="contentsPer-message-top">
                    <h3>| 账号信息</h3>
                    <span>可通过绑定手机或编辑客户重置客户密码</span>
                  </div>
                  <div class="contents-message-header">
                    <el-row class="messageRow1">
                      <el-col :span="10" class="messageRow1Td">
                        <span>客户编号</span>
                        <span>客户编号</span>
                      </el-col>
                      <el-col :span="10" :offset="2" class="messageRow1Td">
                        <span>默认发货仓库</span>
                      </el-col>
                    </el-row>
                    <el-row class="messageRow1">
                      <el-col :span="10" class="messageRow1Td">
                        <span>归属区域</span>
                        <span>所在地区</span>
                      </el-col>
                    </el-row>
                  </div>
                </div>
                <div class="contentsMoney-message">
                  <h3>| 财务信息</h3>
                  <div class="contents-message-header">
                    <el-row class="messageRow1">
                      <el-col :span="10" class="messageRow1Td">
                        <span>客户名称</span>
                        <span>tiong</span>
                      </el-col>
                      <el-col :span="10" :offset="2" class="messageRow1Td">
                        <span>客户类型</span>
                        <span style="display:inline-block;margin-left:24px">普通代理商（折扣比例100%）</span>
                      </el-col>
                    </el-row>
                    <el-row class="messageRow1">
                      <el-col :span="10" class="messageRow1Td">
                        <span>客户编号</span>
                        <span>miri01</span>
                      </el-col>
                      <el-col :span="10" :offset="2" class="messageRow1Td">
                        <span>默认发货仓库</span>
                        <span>总部仓库</span>
                      </el-col>
                    </el-row>
                    <el-row class="messageRow1">
                      <el-col :span="10" class="messageRow1Td">
                        <span>归属区域</span>
                        <span>子区域</span>
                      </el-col>
                      <el-col :span="10" :offset="2" class="messageRow1Td">
                        <span>所在地区</span>
                        <span style="display:inline-block;padding-left:24px">所在地区</span>
                      </el-col>
                    </el-row>
                    <el-row class="messageRow1">
                      <el-col :span="10" class="messageRow1Td">
                        <span>联系地址</span>
                        <span>联系地址</span>
                      </el-col>
                      <el-col :span="10" :offset="2" class="messageRow1Td">
                        <span>邮编</span>
                        <span style="display:inline-block;padding-left:47px">邮编</span>
                      </el-col>
                    </el-row>
                  </div>
                </div>
                <div class="contentsMoney-message">
                  <h3>| 结款周期</h3>
                  <div class="contents-message-header">
                    <el-row class="messageRow1">
                      <el-col :span="10" class="messageRow1Td">
                        <span>客户名称</span>
                        <span>tiong</span>
                      </el-col>
                      <el-col :span="10" :offset="2" class="messageRow1Td">
                        <span>客户类型</span>
                        <span style="display:inline-block;margin-left:24px">普通代理商（折扣比例100%）</span>
                      </el-col>
                    </el-row>
                    <el-row class="messageRow1">
                      <el-col :span="10" class="messageRow1Td">
                        <span>客户编号</span>
                        <span>miri01</span>
                      </el-col>
                      <el-col :span="10" :offset="2" class="messageRow1Td">
                        <span>默认发货仓库</span>
                        <span>总部仓库</span>
                      </el-col>
                    </el-row>
                  </div>
                </div>
              </div>
            </el-tab-pane>
            <el-tab-pane label="客户分析" name="second">
              <div class="cusReject">
                <div class="cusReject-header">
                  <el-radio-group v-model="tabPosition" style="margin-bottom: 30px;">
                    <el-radio-button label="top">本周</el-radio-button>
                    <el-radio-button label="right">上周</el-radio-button>
                    <el-radio-button label="bottom">本月</el-radio-button>
                    <el-radio-button label="left">上月</el-radio-button>
                  </el-radio-group>
                  <el-date-picker
                    v-model="value2"
                    type="daterange"
                    align="right"
                    unlink-panels
                    range-separator="~"
                    start-placeholder="开始日期"
                    end-placeholder="结束日期"
                    :picker-options="pickerOptions"
                    style="margin-left:15px"
                  ></el-date-picker>
                </div>
                <el-row class="cusRejectRow">
                  <el-col :span="4" class="cusRejectRowShu">
                    <span>订单货数</span>
                    <span>0</span>
                  </el-col>
                  <el-col :span="4" class="cusRejectRowShu">
                    <span>退货单数</span>
                    <span>0</span>
                  </el-col>
                  <el-col :span="4" class="cusRejectRowShu">
                    <span>订货金额</span>
                    <span>0</span>
                  </el-col>
                  <el-col :span="4" class="cusRejectRowShu">
                    <span>退货金额</span>
                    <span>￥0.00</span>
                  </el-col>
                  <el-col :span="4">
                    <span>平均客单价</span>
                    <span>￥0.00</span>
                  </el-col>
                  <el-col :span="4">
                    <span>下单频率</span>
                    <span style="color:#FF383E">无</span>
                  </el-col>
                </el-row>
                <div class="cusReject-footer">
                  <el-row class="cus-footerRow">
                    <el-col :span="2" class="title">最近下单</el-col>
                    <el-col :span="2" :offset="10" class="title">最近登陆</el-col>
                  </el-row>
                  <div class="cus-footerRow2">
                    <el-row class="row2Order">
                      <el-col :span="3" class="row2Order1">单号</el-col>
                      <el-col :span="4" class="row2Order1">订单金额</el-col>
                      <el-col :span="3" class="row2Order1">下单时间</el-col>
                      <el-col :span="3" class="login" style="margin-left:100px">登陆IP</el-col>
                      <el-col :span="4" class="login">登陆类型</el-col>
                      <el-col :span="3" class="login">登陆时间</el-col>
                    </el-row>
                    <el-row>
                      <el-col :span="10" class="noOrder1">还未下单</el-col>
                      <el-col :span="10" class="noOrder2">
                        <span style="padding-left:55px;">115.132.162.102</span>
                        <span style="padding-left:60px">手机商城</span>
                        <span style="padding-left:120px">21天前</span>
                      </el-col>
                    </el-row>
                    <el-row>
                      <el-col :span="10" :offset="12" class="last">
                        <span style="padding-left:55px;">115.132.162.102</span>
                        <span style="padding-left:60px">手机商城</span>
                        <span style="padding-left:120px">21天前</span>
                      </el-col>
                    </el-row>
                  </div>
                </div>
              </div>
            </el-tab-pane>
            <el-tab-pane label="报价单" name="third">
              <div class="price">
                <div class="price-header">
                  <input
                    type="search"
                    name
                    id
                    placeholder="请输入名称/编号/规格/规划编号"
                    class="price-headerInput"
                  >
                  <el-select v-model="value" placeholder="请选择" class="price-headerSelect">
                    <el-option
                      v-for="item in options"
                      :key="item.value"
                      :label="item.label"
                      :value="item.value"
                    ></el-option>
                  </el-select>
                  <el-checkbox v-model="checked" class="price-headerCheck">只看常用商品</el-checkbox>
                  <p @mouseover="showOver()" @mouseleave="showLeave()">导出</p>
                  <div class="tanDao" v-show="showDao">
                    <p>导出全部</p>
                    <p>导出常用商品</p>
                  </div>
                </div>
                <el-table
                  :data="tableData"
                  style="width: 100%"
                  :default-sort="{prop: 'buy', order: 'buyCount'}"
                  class="tableDataRow"
                >
                  <el-table-column label="商品名称/商品编号" width="350">
                    <div v-for="(site,key) in tableDataGoods" :key="key" class="divGoods">
                      <img src alt class="imgGoods">
                      <span>{{site.goodsName}}</span>
                      <span>{{site.goodsBian}}</span>
                    </div>
                  </el-table-column>
                  <el-table-column prop="danwei" label="单位" width="180"></el-table-column>
                  <el-table-column prop="price" label="订货价"></el-table-column>
                  <el-table-column prop="guige" label="多规格" width="180"></el-table-column>
                  <el-table-column prop="buy" label="最近购买" sortable width="180"></el-table-column>
                  <el-table-column prop="buyCount" label="购买次数" sortable></el-table-column>
                </el-table>
                <div class="tanEdit" v-show="showEdit">
                  <div class="tanEdit-header">
                    <p>设置客户指定价</p>
                    <p style="cursor:pointer" @click='hiddenEdit()'>X</p>
                  </div>
                  <div class="tanEdit-center">
                    <img src alt class="img">
                    <div class="tanEdit-center2">
                      <p>商品名称：露韩饰 V7气垫BB霜CC粉底 遮瑕提亮均匀隔离遮盖粗大毛孔斑点</p>
                      <p>商品编号：A45613</p>
                      <p>规格名称：15g，规格编号：A45613</p>
                      <p>销售价： ￥{{input}}</p>
                      <div class="tanEditDiv">
                        <input v-model="input" placeholder="请输入价格" class="tanEditInput">
                        <span>/盒</span>
                      </div>
                    </div>
                  </div>
                  <div class="tanEditFooter">
                    <button @click='hiddenEdit()'>取消</button>
                    <button>确定</button>
                  </div>
                </div>
              </div>
            </el-tab-pane>
          </el-tabs>
        </div>
      </div>
    </V-CommonHeaderLeft>
  </div>
</template>

<script>
import VCommonHeaderLeft from './../common/vCommonHeaderLeft/VCommonHeaderLeft'
export default {
  components: {
    VCommonHeaderLeft
  },
  data () {
    return {
      //  标签页默认name值
      activeName: 'third',
      // 客户分析的标签页name默认值
      tabPosition: 'left',
      // 日期选择器：
      pickerOptions: {
        shortcuts: [{
          text: '最近一周',
          onClick (picker) {
            const end = new Date()
            const start = new Date()
            start.setTime(start.getTime() - 3600 * 1000 * 24 * 7)
            picker.$emit('pick', [start, end])
          }
        }, {
          text: '最近一个月',
          onClick (picker) {
            const end = new Date()
            const start = new Date()
            start.setTime(start.getTime() - 3600 * 1000 * 24 * 30)
            picker.$emit('pick', [start, end])
          }
        }, {
          text: '最近三个月',
          onClick (picker) {
            const end = new Date()
            const start = new Date()
            start.setTime(start.getTime() - 3600 * 1000 * 24 * 90)
            picker.$emit('pick', [start, end])
          }
        }]
      },
      value1: '',
      value2: '',
      // 报价单的下拉框
      options: [{
        value: '选项1',
        label: '黄金糕'
      }],
      value: '',
      checked: true,
      showDao: false,
      // 表格数据
      tableData: [{
        danwei: '瓶',
        price: '20.00/瓶',
        guige: '1种',
        buy: '',
        buyCount: ''
      }],
      tableDataGoods: [{
        url: '图片',
        goodsName: 'hair shampoo',
        goodsBian: '1'
      }],
      input: '',
      // 点击编辑弹出框
      showEdit: false
    }
  },
  methods: {
    showOver () {
      this.showDao = true
    },
    showLeave () {
      this.showDao = false
    },
    hiddenEdit () {
      this.showEdit = false
    }
  }
}
</script>

<style lang="scss" scoped>
#app {
  width: 100%;
  background-color: #f2f5f7;
  height: 100%;
  padding: 15px 10px 0px 10px;
}
.header {
  height: 45px;
  .header-nav {
    line-height: 30px;
    font-size: 12px;
    display: flex;
    justify-content: space-around;
    padding-left: 10px;
    span {
      display: inline-block;
      margin-left: 10px;
    }
    a {
      color: #999999;
    }
    a:hover {
      color: #20ade5;
    }
  }
  .header-img {
    width: 25px;
    height: 25px;
    border-radius: 5px;
    border: 1px solid #dce4e7;
  }
}
.header-nav a:nth-child(4) {
  color: #333;
}
.header-nav a:nth-child(4):hover {
  color: #333;
}
.shuImg {
  width: 20px;
  height: 20px;
  border: 1px solid;
}
.contents {
  padding: 10px 0px 0px 0px;
  width: calc(100% - 15px);
  height: 500px;
  background-color: #fff;
}
.contentsAb {
  position: absolute;
  right: 50px;
}
.contentsAb > span {
  display: line-block;
  margin-left: 15px;
  color: #20ade5;
}
.contents-info {
}
.contents-message > h3 {
  font-size: 16px;
  border-bottom: 1px solid #e3e3e3;
  margin: 0px 20px 0px 20px;
  padding-bottom: 10px;
}
.contents-message-header {
  padding: 0px 0px 0px 20px;
  font-size: 12px;
  color: #666666;
}
.activeName /deep/ .el-tabs__item {
  width: 145px;
  text-align: center;
  font-size: 16px;
}
.messageRow1 {
  margin-top: 25px;
}
.messageRow1Td {
  padding-bottom: 15px;
  border-bottom: 1px solid #f5f5f5;
}
.messageRow1Td span:nth-child(1) {
  margin-right: 70px;
}
.messageImg {
  width: 200px;
  height: 50px;
  border: 1px solid;
  margin-left: 70px;
}
.messageRow1Td2 {
  padding-bottom: 15px;
  display: flex;
}
.messageRow1Td2 span {
  line-height: 50px;
}
.contentsPer-message {
}
.contentsPer-message > h3 {
  font-size: 16px;
  border-bottom: 1px solid #e3e3e3;
  margin: 70px 20px 0px 20px;
  padding-bottom: 10px;
}
.contentsPer-message-top {
  display: flex;
  border-bottom: 1px solid #e3e3e3;
  margin: 70px 20px 0px 20px;
  padding-bottom: 10px;
}
.contentsPer-message-top > h3 {
  font-size: 16px;
}
.contentsPer-message-top > span {
  display: inline-block;
  margin: 10px 0px 0px 20px;
  font-size: 12px;
  color: #666;
}
.contentsMoney-message {
  margin-top: 50px;
}
.contentsMoney-message > h3 {
  font-size: 16px;
  border-bottom: 1px solid #e3e3e3;
  margin: 70px 20px 0px 20px;
  padding-bottom: 10px;
}
.cusReject {
  padding-left:20px;
}
.cusReject-header {
  display: flex;
}
.cusRejectRow {
  text-align: center;
  margin-top: 15px;
  font-size: 12px;
  padding-bottom: 30px;
  border-bottom: 1px solid #e3e3e3;
  width: 98%;
}
.cusRejectRow span {
  display: block;
  color: #666666;
}
.cusRejectRow span:nth-child(2) {
  color: #333;
  font-weight: bold;
  margin-top: 10px;
  font-size: 16px;
}
.cusRejectRowShu {
  border-right: 1px solid #e3e3e3;
}
.cus-footerRow {
  padding-top: 20px;
}
.title {
  font-weight: bold;
}
.row2Order {
  margin-top: 15px;
}
.row2Order1 {
  height: 50px;
  background-color: #fcfcfc;
  text-align: center;
  line-height: 50px;
  color: #666;
  font-size: 14px;
}
.login {
  height: 50px;
  background-color: #fcfcfc;
  text-align: center;
  line-height: 50px;
  color: #666;
  font-size: 14px;
}
.noOrder1 {
  border-bottom: 1px solid #e3e3e3;
  padding-bottom: 10px;
  text-align: center;
  margin-top: 20px;
  color: #666;
  font-size: 14px;
}
.noOrder2 {
  margin-left: 100px;
  border-bottom: 1px solid #e3e3e3;
  padding-bottom: 10px;
  margin-top: 20px;
  color: #666;
  font-size: 14px;
}
.noOrder2 {
  display: flex;
}
.last {
  border-bottom: 1px solid #e3e3e3;
  padding-bottom: 10px;
  margin-top: 20px;
  color: #666;
  font-size: 14px;
}
.cus-footerRowLogin {
  height: 50px;
  background-color: #fcfcfc;
  text-align: center;
  line-height: 50px;
  color: #666;
  font-size: 14px;
}
.price-headerInput {
  border: 1px solid #dcdfe6;
  width: 240px;
  height: 40px;
  border-radius: 5px;
  margin-left:20px;
}
.price-headerInput::placeholder {
  font-size: 12px;
  color: #c0c4cc;
}
.price-headerInput:hover {
  border: 1px solid #20ade5;
}
.price-headerSelect {
  margin-left: 20px;
}
.price-headerCheck {
  margin-left: 20px;
}
.price-header > p {
  color: #20ade5;
  float: right;
  margin-right: 50px;
  cursor: pointer;
}
.tanDao {
  width: 150px;
  height: 80px;
  background-color: #fff;
  box-shadow: 0px 0px 5px 2px #f0efef;
  border: 1px solid #f0efef;
  float: right;
  margin-top: 40px;
  margin-right: -60px;
}
.tanDao > p {
  line-height: 40px;
  font-size: 12px;
  text-indent: 1em;
}
.tanDao > p:nth-child(1) {
  border-bottom: 1px solid #f0efef;
}
.tableDataRow {
  margin-top: 15px;
  overflow-x: hidden;
  overflow-y: scroll;
  height: 340px;
}
.tableDataRow /deep/ th {
  background-color: #fcfcfc;
  border-top: 2px solid #e3e3e3;
}
.imgGoods {
  width: 50px;
  height: 50px;
  border: 1px solid;
  float: left;
  margin-right: 10px;
}
.divGoods > span {
  display: block;
}
.tanEdit {
  width: 820px;
  height: 350px;
  background-color: #fff;
  border: 1px solid;
  position: absolute;
  top: 20px;
  left: 100px;
  z-index: 5;
}
.tanEdit-header {
  height: 50px;
  line-height: 50px;
  display: flex;
  border-bottom: 2px solid #ececec;
  background-color: #f5f5f5;
}
.tanEdit-header > p:nth-child(1) {
  margin-left: 40%;
}
.tanEdit-header > p:nth-child(2) {
  margin-left: 43%;
  color: #949494;
}
.tanEdit-center {
  display: flex;
}
.img {
  width: 200px;
  height: 200px;
  border: 1px solid #e3e3e3;
  margin: 10px 0px 0px 10px;
}
.tanEdit-center2 > p {
  font-size: 12px;
  line-height: 30px;
  margin-left: 30px;
}
.tanEditInput {
  width: 100px;
  height: 30px;
  border: 1px solid #e3e3e3;
}
.tanEditInput:hover {
  border-color: #20ade5;
}
.tanEditInput::placeholder {
  font-size: 12px;
}
.tanEditDiv {
  display: flex;
  margin: 15px 0px 0px 45px;
}
.tanEditDiv > span {
  font-size: 12px;
  display: block;
  margin: 5px 0px 0px 10px;
}
.tanEditFooter {
  display: flex;
  height: 50px;
  border-top: 2px solid #e3e3e3;
  margin-top: 20px;
}
.tanEditFooter > button {
  width: 65px;
  height: 30px;
  font-size: 12px;
}
.tanEditFooter > button:nth-child(1) {
  border: 1px solid #20ade5;
  background-color: #fff;
  color: #20ade5;
  margin: 15px 0px 0px 80%;
}
.tanEditFooter > button:nth-child(2) {
  background-color: #20ade5;
  color: #fff;
  border: 0;
  margin: 15px 0px 0px 20px;
}
</style>
